import java.lang.Math;

public class Vektor
  {
  private double x;
  private double y;
  public Vektor(double x,double y)
    {
    this.x=x;
    this.y=y;
    }
  public double module()
    {
    return Math.sqrt(x*x+y*y);
    }
  public Vektor versor()
    {
    double ip=module();
    return new Vektor(x/ip,y/ip);
    }
  public double getX()
    {
    return x;
    }
  public double getY()
    {
    return y;
    }
  public Vektor mul(double c)
    {
    return new Vektor(x*c,y*c);
    }
  public Vektor sub(Vektor v)
    {
    return new Vektor(x-v.getX(),y-v.getY());
    }
  public Vektor add(Vektor v)
    {
    return new Vektor(x+v.getX(),y+v.getY());
    }
  public Vektor orthogonal()
    {
    return new Vektor(-y,x);
    }
  public Vektor rotate(double a)
    {
    return new Vektor(x*Math.cos(a)-y*Math.sin(a),x*Math.sin(a)+y*Math.cos(a));
    }
  }
